#pragma once

#include "topcvt_unpack.hpp"
#include "iso8583_helper.hpp"

namespace topcvt
{
	class ISO8583Unpack : public UnpackImp
	{
		unsigned char m_bitmap[ISO8583_BITMAP_LEN + 1];
		vector<string> m_fldList;
	public:
		ISO8583Unpack(ByteBuffer& message);

		void checkElementCfgValid(AttributeableCfg& t) override;
		PolicyContext& unpackPolicy(PolicyContext& PolicyContext, PolicyCfg& policyCfg) override;
		string unpackField(pugi::xml_node& node, FieldCfg& cfg, PolicyContext& ctx) override;
	private:
		bool isValidFld(int nFldNo);
	};
};